// 在后面的 main.ts 中引入该模块，包括所有接口数据信息写入该文件中。vue页面需要使用的api接口
// 其中使用 install 的目的在于 ts在main.ts中
// 不能通过Vue.prototype.$Api这个方式直接调用
//，在全局方法中会说到使用 插件的方式去挂载。
// main.ts
//import api from "./axios/api";
// 由于api该模块已经注册成组件了，所以main中直接使用该组件便可
//Vue.use(api)
// api.ts
import request from "./request";
import store from "@/store";
class api {

    /* 系统 */
    public static nidtga = {
        /**
        // 基于Base模块封装调用,需要带参数
        get_params: (params = {}) => request.get(`${base.common}/`, params),
        // 基于Base模块封装调用
        get: () =>  request.get(`${base.common}/`),
        // 基于Base模块封装调用,需要带参数
        post_params: (params = {}) => request.post(`${base.common}/`, params),
        // 基于Base模块封装调用
        post: () =>  request.post(`${base.common}/`),
         **/

        login: (params = {}) => request.post_qs(store.state.nidtgaServer+'/login', params),
        nodesFlow: (params = {}) => request.get_qs(store.state.nidtgaServer+'/screen/area/info', params),
        nodeChildFlow: (params = {}) => request.get_qs(store.state.nidtgaServer+'/screen/child/info', params),
        online: (params = {}) => request.get_qs(store.state.nidtgaServer+'/user/lease6/list?limit=10000&offset=0&name', params),
        usersCount: (params = {}) => request.get_qs(store.state.nidtgaServer+'/screen/users/number', params),
        flyLines: (params = {}) => request.get_qs(store.state.nidtgaServer+'/screen/fly_line', params),

        nodesFlowPacket: (params = {}) => request.post_qs(store.state.nidtgaServer+'/nodesFlowPacket', params),
        nodesAllFlow: (params = {}) => request.post_qs(store.state.nidtgaServer+'/nodesAllFlow', params),
        userTotal: (params = {}) => request.post_qs(store.state.nidtgaServer+'/userTotal', params),
    }

    /* 区块链 */
    public static nodes  = {
        nodes: (params = {}) => request.get_qs(store.state.nodesServer+'/screen/node', params),
    }
}

export {
    api
}
